# region imports
from AlgorithmImports import *
# endregion

class SwimmingGreenBull(QCAlgorithm):

    def initialize(self):

        # Set start date 
        self.set_start_date(2026, 3, 20)

        # Set cash
        self.set_cash(100000)

        # Add future
        future_object = self.add_future(ticker = Futures.Energy.CRUDE_OIL_WTI, resolution = Resolution.MINUTE, fill_forward = False, extended_market_hours = True)

        # Set filter
        future_object.set_filter(min_expiry_days = 0, max_expiry_days = 60)

        # Symbols list
        self.symbols_list = []
    
    def on_securities_changed(self, changes):

        # Loop added securities
        for contract in changes.added_securities:

            # Check if it's not a continuous futures contract
            if "/" not in contract.symbol.value:

                # Store symbol
                self.symbols_list.append(contract.symbol)
        
        # Loop removed securities
        for contract in changes.removed_securities:

            # Remove from symbols list
            self.symbols_list.remove(contract.symbol)

    def on_data(self, data: Slice):
        
        # Pass
        pass